<template>
  <van-cell-group title="考评跟踪" class="panel-history-process">
    <van-empty v-if="historys.length === 0" description="无考评历史信息" />
    <van-steps direction="vertical" :active="0">
      <van-step
        v-for="(history) in historys"
        :key="history.id">
        <van-row>
          <van-col span="10">
            <span>考评类型：</span>{{history.obj_type === 0 ? '扣分' : '加分'}}
          </van-col>
          <van-col span="14">
            <span>考评操作：</span>{{operateName(history.obj_type,history.op_event)}}
          </van-col>
        </van-row>
        <van-row>
          <!-- <van-col span="10">
            <span>操作人员：</span>{{history.op_username}}
          </van-col> -->
          <van-col span="14">
            <span>操作时间：</span>{{history.create_time}}
          </van-col>
        </van-row>
        <van-row><span>操作内容：</span>{{history.op_content}}</van-row>
      </van-step>
    </van-steps>
  </van-cell-group>
</template>

<script>
export default {
  name: 'PanelHistoryProcess',
  props: ['historys'],
  methods: {
    operateName: function (t, value) {
      let opTxt = ''
      if (t === 0) {
        switch (value) {
          case 'save':
            opTxt = '评分保存'
            break
          case 'grade':
            opTxt = '评分提交'
            break
          case 'check':
            opTxt = '评分审核'
            break
          case 'feedback':
            opTxt = '评分反馈'
            break
          case 'feedback_modify':
            opTxt = '反馈修改'
            break
          case 'approve':
            opTxt = '反馈审核'
            break
          case 'approve_review':
            opTxt = '反馈复核'
            break
          case 'review':
            opTxt = '反馈终审'
            break
          case 'complete':
            opTxt = '考评完成'
            break
        }
      }

      if (t === 1) {
        switch (value) {
          case 'create':
            opTxt = '加分申请'
            break
          case 'check':
            opTxt = '加分审核'
            break
          case 'feedback_modify':
            opTxt = '加分申请修改'
            break
          case 'approve_review':
            opTxt = '加分复核'
            break
          case 'review':
            opTxt = '加分终审'
            break
          case 'complete':
            opTxt = '考评完成'
            break
        }
      }
      return opTxt
    }
  }
}
</script>

<style scoped lang="less">

</style>
